<!DOCTYPE html>
<html>
<head>
    <title>活动详情页 {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@mobile_head"/>
    <hook name="before_head_end"/>
    <style type="text/css">
    	.v-box{font-size: 1.5rem;}
    	.btn-join{background: #2175cd;}
    	.qrcode{text-align: center;}
    </style>
 </head>
<body class="page-activity-details">
<div class="container">
	
	<div class="contents">
		<h2>{$m_activity.title}</h2>
		<div class="para">
			<div class="iconfont">&#xe60a;</div>
			<div class="v-box">
				<div class="label">活动地点：</div>
				<div class="value">
					<foreach name="$m_activity.place" id="vo" >
					<p>{$vo}</p>
				</foreach>
				</div>
			</div>
		</div>
		<div class="para">
			<span class="iconfont">&#xe6d3;</span><span class="v-box">活动日期：{$m_activity.start_time|date='Y-m-d'}</span>
		</div>
		<div class="para">
			<span class="iconfont">&#xe6d3;</span><span class="v-box">活动时间：</span>
			{$m_activity.start_time|date='H:i:s'}
		</div>
		<div class="para">
			<div class="iconfont">&#xe6a3;</div>
			<div class="v-box">
				<div class="label">活动内容：</div>
				<div class="v-box">{$m_activity.content}</div>
			</div>
		</div>
		<div class="para">
			<span class="iconfont">&#xe70e;</span><span class="v-box">参与人数：{$m_activity.user_count}人</span>
		</div>
		<!--<div class="para">-->
			<!--<span class="iconfont">&#xe612;</span><span class="v-box">活动时长：{\\$m_activity.time_long|gmstrftime='%H:%M:%S',###}</span>-->
		<!--</div>-->

		<notempty name="$m_activity.show">
		<div class="para">
			<div class="iconfont">&#xe659;</div>
			<div class="v-box">
				<div class="label">活动成果：</div>
				<div class="value">{$m_activity.show}</div>
			
		</div>
		</div>
		</notempty>
		<empty name="$m_activity.show">

				<!--<div class="qrcode">-->
					<!--<a href="javascript:;" class="layui-btn btn-primary btn-block btn-pre-join" data-id="{$m_activity.id}">报名活动</a>-->
				<!--</div>-->

				<div class="qrcode">
					<!--<a href="{:url('signin')}" class="layui-btn btn-primary btn-block ">活动签到</a>-->
					<a href="javascript:;" class="layui-btn btn-primary btn-block btn-pre-join" data-id="{$m_activity.id}">报名活动</a>
					<a href="javascript:;" class="layui-btn btn-primary btn-block btn-join" data-id="{$m_activity.id}">活动签到</a>
				</div>


		</empty>
	</div>
</div>
<include file="public@mobile_footer_nav">
<include file="public@mobile_footer">
<script type="text/javascript">
(function($){
	"use strict";
	function ajax_join(_id){
		$.ajax({
			url:'{:url("ajax_join")}',
			method:'POST',
			data:{id:_id},
			success:function(rsp){
				layui.use('layer', function(){
				  layui.layer.msg(rsp.errmsg);
				});
				if(rsp.error==false){
				setTimeout(window.location.href='{:url("signin")}', 2000 )
				};

			}
		})
	}
	//预报名
	function pre_join(_id){
		$.ajax({
			url:'{:url("pre_join")}',
			method:'POST',
			data:{id:_id},
			success:function(rsp){
				console.log(rsp)
				layui.use('layer', function(){
					layui.layer.msg(rsp.errmsg);
				});
				if(rsp.error) return;
			}
		})
	}

	function bind_events(){
		$('.btn-join').off("click").on("click",function(e){
			e.preventDefault();
			var _id = $(this).data('id');
			ajax_join(_id);
		});
		$('.btn-pre-join').off("click").on("click",function(e){
			e.preventDefault();
			var _id = $(this).data('id');
			pre_join(_id);
		});
	}
      $(function(){
      	bind_events();
      })

})(jQuery)

</script>
</body>
</html>